package org.example.hive3.job;

public class EtlUtils {
    public static String etlVideoData(String srcData) {
        StringBuffer sf = new StringBuffer();
        String[] videoInfo = srcData.split("\t");
        if (videoInfo.length < 9) {
            return null;
        }
        videoInfo[3] = videoInfo[3].replace(" ", "");
        //  associate videos with &
        for (int i = 0; i < videoInfo.length; i++) {
            if (i < 9) {
                if (i == videoInfo.length - 1) {
                    sf.append(videoInfo[i]);
                } else {
                    sf.append(videoInfo[i]).append("\t");
                }
            } else {
                if (i == videoInfo.length - 1) {
                    sf.append(videoInfo[i]);
                } else {
                    sf.append(videoInfo[i]).append("&");
                }
            }
        }
        return null;
    }
}
